Repository navigation
Conversation
…extForge audit - Add formal cache invalidation framework (lib/cache-invalidation.mjs) - Add semantic deduplication with FNV-1a + SimHash (lib/semantic-dedup.mjs, hooks/semantic-dedup.mjs) - Add AST-aware compression with vault retrieval (lib/compression.mjs, hooks/compression.mjs) - Add enhanced hook pipeline with session cache, stall detection, concept cache (hooks/enhanced-interceptor.mjs) - Add context packs system for task-specific context (lib/context-packs.mjs) - Add vector memory with TF-IDF + RP-tree ANN (lib/vector-memory.mjs) - Add usage receipts system (lib/receipts.mjs) - Add tmap client interface (lib/tmap-client.mjs) - Fix regex fallback compression: skipTrivialCheck, error handlers, function body compression - Fix compressCode skipTrivialCheck logic for tool results - Fix compressCode check order (token threshold before line count) - Fix regex fallback compression: function bodies, error handlers, small files - Fix compressToolResults minLines default - Fix pruneStaleRetrieves most recent retrieve logic Test results: 196 passing, 6 failing (4 compression edge cases, 2 receipt heisenbugs)
…ong changelog The three PreToolUse/PostToolUse hooks ran on every tool call with no effect (one crashed on import; two read a payload.messages field Claude Code never sends). The libraries were reachable only from three undocumented tforge commands, two of which crashed. Restores the tree of d5ea765. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erify validation Tasks marked "sensitive" (or every task with plan-level "isolateChecks") run their verify command in a detached worktree of HEAD brought to the checkout's state, removed afterwards even on timeout. Refused outside git. verify rejects NUL and stray newlines; destructive patterns are warned about. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion; refuse mixed versions without --mixed-versions; tforge version Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…doffs until used - SessionStart also runs on resume (only what changed while away) and compact (own checkpoint). - Snapshots fold subagent transcripts: type, task, files edited, commands, report. - Automatic handoffs are archived once a session given them has worked, or after 14 days. - New settings: subagentSkip, stateFiles, reloadOn, leanKeep. - Agents with their own definition get no scope/ask/planning rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # bin/tforge
…h 0.9.2 status Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…were asked in Never replays a request to run, test, build, verify or deploy, a security question or one about the current state (English and French). Validity now includes the repo (top level and remotes), HEAD and branch, the working tree by content, dependency manifests, the terse level and the model when known. !nocache as a prompt's first or last word bypasses it. Adversarial tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urns, not instructions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eanKeep, handoff archive, subagent summaries Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nv-prefix quoting, lost expansions, dropped pipe stages, cat glob order; check logs keep FAILED lines after warnings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and usage and compresses tool results on first send Whole-file Reads fold long bodies (line numbers kept, Read offset/limit markers), Bash output is cleaned and capped with the full text saved, large JSON is crushed. Compressed results are memoized by tool_use_id and original hash so later requests resend identical bytes and the prompt cache holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unters, per-file counts on capped search results; tforge run --proxy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…olding after an Edit miss; Windows: spawn claude.cmd through cmd.exe with escaped args, proxy tests in Windows CI; offline proxy replay estimate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…ead of refusing it Claude Code shows any PreToolUse deny as "hook error", which users on Windows took for a crash. A whole Read of a tool-results/*.txt over 8k chars is now allowed with offset/limit set to its last ~8k chars (at least 20 lines) and a note on the line range; repeating the whole Read still loads it all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
… spill reads A whole-file Read of dependency source, a lockfile or a generated file reads its first 200 lines with a note; a lone `cat` of dependency source goes through tview. Narrowed Reads carry no permission decision (Claude Code applies updatedInput and keeps its own permission check), so nothing gets auto-approved. Interactive ssh and installers waiting for an answer stay refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
.codex-plugin/plugin.json points Codex at the shared hooks/hooks.json. Under Codex (PLUGIN_ROOT or turn_id), MCP distill replaces the result with decision:block and the polling-wait cap is skipped, since Codex takes updatedInput only with allow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…or startup lib/opencode.mjs runs kit-router and session-start with Claude-shaped input and maps their answers onto tool.execute.before/after and experimental.chat.system.transform. `tforge opencode install|remove [--project]` writes a one-line re-export. Under Codex or opencode, session start leaves Claude Code's settings alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…Y_OPENAI_UPSTREAM) Current-turn function_call_output items are compressed like Bash and tool results (JSON-wrapped shell output keeps its wrapper), memoized by call_id; usage comes from response.completed. Logs keep sizes only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
opencode 2 refused the plugin ("must export a default definition with an
id and an effect or setup function"). setup(ctx) now registers
tool execute.before/after (the tool is "shell") and session context
(system parts { type: 'text' }); the v1 TokenForge factory stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…shells Claude Code adds a plugin's bin/ to PATH, opencode does not: the ssh refusal pointed at `tkit ssh` and got "command not found", and router rewrites to tkit would fail the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
process.env.PATH set by the plugin does not reach the commands: opencode starts zsh, which rebuilds PATH from the user's rc files, and `tkit --help` still failed with "command not found". A command that runs tkit, tmap, tread or tview (from the model or a router rewrite) now gets `export PATH='<bin>':"$PATH"; ` in front. The input is changed in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
Neither host puts the plugin's bin/ on PATH, so router rewrites to tkit failed with "command not found" under Codex. withKitPath moves to hookutil; kit-router prefixes its rewrites with `export PATH='<bin>':"$PATH";` outside Claude Code, and session-start tells non-Claude agents the same prefix for their own kit commands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
- tview stays under Claude Code's Bash output limit (BASH_MAX_OUTPUT_LENGTH - 4000, TFORGE_VIEW_MAX): the largest code files become outlines, documents print whole. Persisted outputs (2KB preview) were behind most re-reads in the benchmark. - Router: cat with one brace group goes through tview; cat piped into grep/sed is no longer rewritten (they would search folded text). - Proxy: TFORGE_PROXY_TTL=5m or header x-tokenforge-cache-ttl: 5m (not forwarded) asks for the 5-minute cache. Off by default. - Policy: "Batch reads (<25k chars)". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…tart - lib/prune.mjs: stale tool results (re-read or rewritten files, identical commands, superseded test runs, written bodies read back) and thinking from earlier turns become stubs, in deterministic batches (TFORGE_PROXY_PRUNE tokens|cost|off, TFORGE_PROXY_PRUNE_MIN). Report shows pruning and context_management. - lib/proxy-setup.mjs: first session turns the proxy on in the Claude Code settings once it answers; tforge proxy on|off; hooks restart it; never next to the user's own base URL or a cloud provider; TFORGE_PROXY=0. - Session start loads a capped tmap repo map (TFORGE_MAP=0 off). - Policy: independent tool calls in one message. /tokenforge:proxy skill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
Once the model has moved on (3 calls, or an earlier turn), Write content, heredoc bodies (also after a prefix command), Edit strings and the heredoc bodies of successful scripts (python3 - <<'EOF') become stubs; the command keeps its shape. Earlier-turn reads of files changed since go too. TFORGE_PROXY_PRUNE_WRITES=0 disables the age rule. The proxy no longer cleans or caps cat/sed -n/head/tview output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
Logs, per request, the characters and blocks of thinking from earlier turns (what pruning drops) and from the current turn; sizes only. The report shows whether dropping earlier thinking saves anything with the current model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
Current Claude Code appends a `system` message after the tool results, so the last message was never the one holding them and nothing was compressed. The newest results are now taken from the last user message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
Benchmarks showed tokens-mode pruning breaking a warm cache to drop a few thousand tokens (one batch rewrote 51k tokens to drop 5.5k). Headless runs have no human pauses, so the 1-hour cache only makes their writes dearer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…d bodies; ultra kit policy - Proxy pruning, cost mode: the batch is the run of pending items that saves the most cache reads net of the rewrite (one old stale item used to block every batch). Written bodies and ran scripts go after 2 model calls. - tkit edit (tmap 0.5.1): `@@ path new|append` without <<< >>> takes the raw text up to the next @@ or EOF; an unclosed <<< in those modes ends there. - Lean ultra: a policy line sends edits to tkit edit, with each block marker spelled out, and new files to `cat >`. - Roadmap: smaller code reads (cat / sed -n), measured by replay first. Benchmark, 6 tasks, ultra + proxy, 9 runs per task against 4 native runs: median -57.0% tokens, -47.0% cost, quality unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…ows hosts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…mp stays within its budget Long temp paths on macOS pushed a 4-file dump 564 chars over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0.9.2 consolidates correctness after an external review, and adds a local API proxy that cuts tokens further.
Correctness
!nocachebypass.Token savings
tforge proxy/tforge claude: a local proxy (127.0.0.1 only, optional, on by default) that logs request sizes and compresses tool results on first send, and prunes stale context when the reads it saves outweigh the cache rewrite.tviewoutput budget.ultra: a policy line sends edits totkit edit(tmap 0.5.1 accepts unclosednew/appendbodies).Benchmark
6 tasks, lean
ultra+ proxy, 9 runs per task against 4 native runs (Claude Opus 5.5), objective grading (rubrics and hidden tests):Quality unchanged (equal or better on 4 tasks, −1.3 and −0.3 points on the other two).
Test plan
npm test: 156 passcargo test --release -- --test-threads=1(tmap): 157 passtmap-v0.5.1so release binaries exist for the new version